package us.icitap.cm.business.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.Customizer;
import us.icitap.cm.utils.MyCustomizer;

@Entity
@Customizer(MyCustomizer.class)
@Table(name="DRUG_TYPE", schema="MPC")
@IdClass(ReportRestrictionId.class)
public class ReportRestriction implements Serializable {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6233171947755463383L;

	@Id
	@Column(name="REPORT_ID", insertable = false, updatable=false)
	private Integer reportId;
	

	@Id
	private String username;
	
	@ManyToOne
	@JoinColumn(name="REPORT_ID")
	private Report report;
	
	@Temporal(TemporalType.DATE)
	@Column(name="FROM_DATE")
	@Id
	private Date fromDate;
	
	
	@Temporal(TemporalType.DATE)
	@Column(name="TO_DATE")
	@Id
	private Date toDate;
	
	@Column(name="NO_LIMIT")
	@Id
	private boolean noLimit;
	
	@Id
	private boolean active = true;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DEACTIVATION_DATE")
	private Date deactivationDate;
	
	
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="RECORD_DATE")
	private Date recordDate;
	
	

	public Report getReport() {
		return report;
	}

	public void setReport(Report report) {
		this.report = report;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}


	public Date getRecordDate() {
		return recordDate;
	}

	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}

	public Integer getReportId() {
		return reportId;
	}

	public void setReportId(Integer reportId) {
		this.reportId = reportId;
	}


	public Date getFromDate() {
		return fromDate;
	}

	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}

	public Date getToDate() {
		return toDate;
	}

	public void setToDate(Date toDate) {
		this.toDate = toDate;
	}

	public boolean isNoLimit() {
		return noLimit;
	}

	public void setNoLimit(boolean noLimit) {
		this.noLimit = noLimit;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public Date getDeactivationDate() {
		return deactivationDate;
	}

	public void setDeactivationDate(Date deactivationDate) {
		this.deactivationDate = deactivationDate;
	}
}
